package com.example.master.controller;

import com.example.master.entity.vo.ServiceDetailVo;
import com.example.master.service.*;
import com.example.master.service.Impl.ProductServiceImpl;
import com.example.master.utils.*;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.*;
import org.springframework.web.bind.annotation.*;

import javax.security.auth.*;

/**
 * @Author Mr.Yuan
 * @Date 2023/2/7 15:48
 * @PackageName:com.example.master.controller
 * @ClassName: ServiceController
 * @Description: TODO
 * @Version 1.0
 */
@CrossOrigin
@RestController
@RequestMapping("/serivce")
@Api(tags = "游戏代练", value = "服务Open api 入口")
public class ServiceController {
    @Autowired
    private ServicesService service;

    @Autowired
    ProductServiceImpl productServiceImpl;
    /***
     *
     * @param
     * @return
     */
    @GetMapping("/game/{gameId}")
    @ApiOperation(value = "具体游戏代练服务列表", response = Subject.class)
    public Result subject(@PathVariable("gameId") Integer gameId) {
        Result result = service.findAll(gameId);
        return result;
    }

    //获取服务详情
    @GetMapping("/{id}")
    public ServiceDetailVo getProductDetail(@PathVariable("id") Integer id){
        return  productServiceImpl.getDetailService(id);
    }

}
